package com.papercutting.platform.dto.response;

import lombok.Data;

import java.io.Serializable;

/**
 * 登录响应
 */
@Data
public class LoginResponse implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * JWT令牌
     */
    private String token;
    
    /**
     * 用户信息
     */
    private UserResponse userInfo;
    
    /**
     * 令牌类型
     */
    private String tokenType = "Bearer";
    
    /**
     * 令牌过期时间（秒）
     */
    private Long expiresIn;
    
    public static LoginResponse of(String token, UserResponse userInfo, Long expiresIn) {
        LoginResponse response = new LoginResponse();
        response.setToken(token);
        response.setUserInfo(userInfo);
        response.setExpiresIn(expiresIn);
        return response;
    }
}